
      function viewDetail(item) {
			var xmlhttp;
			var url = "viewDetail?itemId=" + item;
			if (window.XMLHttpRequest) {
				xmlhttp=new XMLHttpRequest();
  			} else {
  				xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
  			}
			xmlhttp.onreadystatechange=function() {
  				if (xmlhttp.readyState==4 && xmlhttp.status==200) {
    				document.getElementById("itemDetail").innerHTML=xmlhttp.responseText;
    			}
  			};
			xmlhttp.open("GET",url ,true);
			xmlhttp.send();
      }
      
      function addToCart() {
      		var dataString = "";
      		var checkboxes = document.getElementsByName("selectedList");
      		for(i = 0; i < checkboxes.length; i++) {
      			console.log(checkboxes.item(i).checked);
      			console.log(document.getElementById(checkboxes.item(i).value).value);
      			if(checkboxes.item(i).checked == true) {
      				if(document.getElementById(checkboxes.item(i).value).value != null && document.getElementById(checkboxes.item(i).value).value != "") {
      					dataString += checkboxes.item(i).value + ":" + document.getElementById(checkboxes.item(i).value).value + ";";
      				}
      			}
      		}
      
      		document.getElementById("itemForm").reset();
      		
			var xmlhttp;
			var url = "addToCart?data=" + dataString;
			if (window.XMLHttpRequest) {
				xmlhttp=new XMLHttpRequest();
  			} else {
  				xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
  			}
			xmlhttp.onreadystatechange=function() {
  				if (xmlhttp.readyState==4 && xmlhttp.status==200) {
    				document.getElementById("shoppingCart").innerHTML=xmlhttp.responseText;
    			}
  			};
			xmlhttp.open("POST",url ,true);
			xmlhttp.send();
      }
